package br.com.rodrigo.activemq;

import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.beans.factory.annotation.Value;

import br.com.rodrigo.constants.Constants;

/**
 *
 * <b>Descricao da Classe:</b><br>
 * TODO Explicar detalhadamente proposito da classe
 *
 * @author rodrigo.bacellar
 * @since 17/11/2014
 *
 */
public class ReceiverCamel extends RouteBuilder
{

    @Value(Constants.EMAIL_FROM)
    private String from;

    @Value(Constants.EMAIL_PASSWORD)
    private String password;

    @Value(Constants.EMAIL_TO)
    private String to;

    @Value(Constants.EMAIL_SUBJECT)
    private String subject;

    @Value(Constants.EMAIL_HOSTNAME)
    private String hostname;

    /*
     * (non-Javadoc)
     * 
     * @see org.apache.camel.builder.RouteBuilder#configure()
     */
    @Override
    public void configure() throws Exception
    {
        String recipients = "&CC=me@you.org&BCC=someone@somewhere.org";

        from("activemq:MY.TEST.FOO.QUEUE")
            .log(LoggingLevel.INFO, this.getClass().getName(), "Mensagem obtida da fila")
                .to("smtps://" + hostname + "?username=" + from + "&password=" + password + "&subject=" + subject +"&To=" + to);

    }
}
